Scripting > CxGrp > GrpClient Object > GrpClient Methods

GrpClient Methods

The GrpClient object contains the following methods:

Group BLOB Naming Rules

File names and file paths as expressed through the Group BLOB functions must adhere to the following rules:

Element Naming Rules
File names
  • Must not be empty and can be no more than 40 characters long.
  • Cannot contain the following characters:
  • \
  • <
  • >
  • :
  • "
  • |
  • ?
  • *
  • The final character cannot be a period (".") or a space (" ").
File paths
  • Each segment of the path, delineated by a slash ("\"), must adhere to the rules for file names.
  • The path must begin with a double slash ("\\") and then the SITE.SERVICE for the desired Group service followed by the path, or with a single slash ("\") and then the path.

Both the complete path and the individual names retain their case, but are case-insensitive for searching, adding, and deleting.

AddDirectory

The AddDirectory method creates a new directory at the specified path with the specified name, if the path exists.

Syntax

AddDirectory(nodePath As String, newName as String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path where the directory will be created in the form "\\SITE.SERVICE\folder1\folder2".

newName

Yes

The name of the directory to create.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

This adds a directory to the path specified. This will only work if the nodePath is valid.

If an invalid path is specified for nodePath, the directory will not be added and no error will be displayed.

Example

The following example adds a folder named "New" to the path specified. It then checks if the folder exists and alerts the user.

Sub addDir()

GrpClient.AddDirectory "\\CYGDEMO.GRP\MyFolder", "New"

edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\MyFolder\New")

'Returns  True

End Sub

Back to top

AddNodeToCache

The AddNodeToCache method adds the Node with the specified ID to the cache.

Syntax

AddNodeToCache(nodeId As String)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to add to the cache.

Example

The following example adds the Node with ID 0000000008 to the cache.

Sub

GrpClient.AddNodeToCache "0000000008"

End Sub

Back to top

AttachChild

The AttachChild method attaches the child with the specified ID to the parent with the specified ID.

Syntax

AttachChild(childNodeId As String, parentNodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the child Node to attach to the parent Node.

parentNodeId

Yes

The ID of the parent Node.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example attaches Node 0000000014 to parent Node 0000000008.

Sub

GrpClient.AttachChild "0000000014", "0000000008"

End Sub

Back to top

CanCreateNodes

The CanCreateNodes method returns true if the user can create nodes in the GRP database.

Syntax

CanCreateNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can create Nodes, and creates a Node.

Sub

Dim bRet

bRet = GrpClient.CanCreateNodes()

 

Dim strNodeId

If bRet Then

strNodeId = GrpClient.CreateNode("L", "~F", "My leaf Node")

End If

 

MsgBox strNodeId

End Sub

Back to top

CanDeleteNodes

The CanDeleteNodes method returns true if the user can delete nodes from the GRP database.

Syntax

CanDeleteNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can delete Nodes, and deletes a Node.

Sub

Dim bRet

bRet = GrpClient.CanDeleteNodes()

 

If bRet Then

GrpClient.DeleteNode "0000000015"

End If

End Sub

Back to top

CanUpdateNodes

The CanUpdateNodes method returns true if the user can update nodes in the GRP database.

Syntax

CanUpdateNodes(GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can update Nodes, and updates a Node attribute.

Sub

Dim bRet

bRet = GrpClient.CanUpdateNodes()

 

If bRet Then

GrpClient.UpdateNodeAttribute "0000000005", "~attryn0", "Yes"

End If

End Sub

Back to top

CheckCacheState

The CheckCacheState method forces an immediate check to see if the service has changed.

Syntax

CheckCacheState(grpService As String)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to which to connect.

Example

The following example evaluates the cache state using the value of the SiteService property from the script’s group client object.

Sub

GrpClient.CheckCacheState GrpClient.SiteService

End Sub

Back to top

Connect

The Connect method connects the object to a service.

Syntax

Connect(DomainSiteService As String)

Parameters

Parameter Required Description

DomainSiteService

Yes

The [Domain]Site.Service to which to connect.  A domain is optional. The service must be a valid GRP.

Remarks

Returns 0 if successful and a non-zero value if the connection failed.

Example

The following example connects the GrpClient object to the CYGDEMO.GRP on domain 5410:

Sub GrpConnect()

'Connect to a GRP

Dim GrpClient

Set GrpClient = CreateObject("CxGrp.GrpClient")

GrpClient.Connect("[5410]CYGDEMO.GRPS")

End Sub

Back to top

CopyGroupBlob

The CopyGroupBlob method copies a Group BLOB node to a specified new Group BLOB location.

Syntax

CopyGroupBlob(nodePath As String, newPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node pathto the node to be copied in the form "\\SITE.SERVICE\folder1\file.txt".

newPath

Yes

The new path for the Node. This must be relative to nodePath, and in the form "\folder1\folder3".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a file. Directories cannot be copied.

If an invalid path is specified for nodePath or newPath, a run-time error will be displayed.

Example

The following example copies "Test.txt" from folder "2" to folder "3", and alerts the user that two copies exist.

Sub copyBlob()

GrpClient.CopyGroupBlob "\\CYGDEMO.GRP\1\2\Test.txt", "\1\3"

MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\2\Test.txt")  'Returns True

MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\3\Test.txt")  'Returns True

End Sub

Back to top

CreateDirectory

The CreateDirectory method creates a directory at the specified path, and all directories above in the full path.

Syntax

CreateDirectory(nodePath As String)

Parameters

Parameter Required Description

nodePath

Y

A node path to create in the form "\\SITE.SERVICE\folder1\folder2".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method creates a complete directory path. It will create any directory in the path that does not exist already.

If nodePath specifies an invalid path, the directory will not be created and no error will be displayed. If the user tries to create a folder that already exists, a new folder will be created inside the existing one with the same name (ex. \\CYGDEMO.GRP\test already exists. CreateDirectory("\\CYGDEMO.GRP\test") will make \\CYGDEMO.GRP\test\test)

Example

The following example creates a directory.

Sub createDir()

GrpClient.CreateDirectory "\\CYGDEMO.GRP\NewFolder\Test\A"

edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\NewFolder\Test\A")

'Returns  True

End Sub

Back to top

CreateNode

The CreateNode method creates a node and returns the new node ID.

Syntax

CreateNode(nodeCat As String, nodeType As String, nodeDesc As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeCat

Yes

The ID of the category of the new Node.  See Node Categories for a list of possible values.

nodeType

Yes

The ID of the type of the new Node.  See Node Types for a list of possible values.

nodeDesc

Yes

The description of the Node.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can create Nodes, and creates a Node.

Sub

Dim bRet

bRet = GrpClient.CanCreateNodes()

 

Dim strNodeId

If bRet Then

strNodeId = GrpClient.CreateNode("L", "~F", "My leaf Node")

End If

 

MsgBox strNodeId

End Sub

Back to top

DeleteNode

The DeleteNode method deletes the specified node.

Syntax

DeleteNode(nodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to delete.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example verifies the user can delete Nodes, and deletes a Node.

Sub

Dim bRet

bRet = GrpClient.CanDeleteNodes()

 

If bRet Then

GrpClient.DeleteNode "0000000015"

End If

End Sub

Back to top

DetachChild

The DetachChild method detaches the child with the specified ID from the parent with the specified ID.

Syntax

DetachChild(childNodeId As String, parentNodeId As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the child Node to detach from the parent Node.

parentNodeId

Yes

The ID of the parent Node.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example detaches Node 0000000014 from parent Node 0000000008.

Sub

GrpClient.AttachChild "0000000014", "0000000008"

End Sub

Back to top

DirectoryExists

The DirectoryExists method returns true if the directory at the specified path exists.

Syntax

DirectoryExists(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A valid node path in the form "\\SITE.SERVICE \folder1\folder2\".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a file or an invalid path, this method will return False.

Example

The following example alerts the user whether or not "MyFolder" exists.

Sub dirExists()

Dim bExists

bExists = GrpClient.DirectoryExists("\\CYGDEMO.GRP\MyFolder\")

If bExists Then

edtMessage.Text = "MyFolder exists"

Else

edtMessage.TExt = "MyFolder does not exist"

End If

End Sub

Back to top

Disconnect

The Disconnect method disconnects from the service.

Syntax

Disconnect() As Integer

Remarks

The Disconnect method returns 0 if successful and a non-zero value if the disconnect failed.

Example

The following example disconnects from the connected GRP service.

Sub

Dim iRet

iRet = GrpClient.Disconnect()

If iRet <> 0 Then

MsgBox "Error in disconnecting"

End If

End Sub

Back to top

FileExists

The FileExists method returns true if the file in the specified path exists.

Syntax

FileExists(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A valid node path in the form "\\SITE.SERVICE \folder1\file.txt".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a folder or an invalid path, this method will return False.

Example

The following example alerts the user whether or not "File.txt" exists.

Sub fileExists()

Dim bExists

bExists = GrpClient.FileExists("\\CYGDEMO.GRP\MyFolder\File.txt")

If bExists Then

edtMessage.Text = "File.txt exists"

Else

edtMessage.TExt = "File.txt does not exist"

End If

End Sub

Back to top

GetAttributeMetadata

The GetAttributeMetadata retrieves information about the columns in use in the current GRP in the form of an array of IGrpAttributeMetadata objects.

Syntax

GetAttributeMetadata As Array()

Back to top

GetAttrValue

The GetAttrValue method retrieves an attribute value for the specified Node.

Syntax

GetAttrValue(nodeId As String, attrIdAsStringOrEnum As Variant, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve an attribute value.

attrIdAsStringOrEnum

Yes

The ID of the attribute, as either the attribute’s name or its enumeration.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves an attribute value and displays it in a message box.

Sub

Dim strVal

strVal = GrpClient.GetAttrValue("0000000005", "~attr0")

 

MsgBox strVal

End Sub

Back to top

GetChildren

The GetChildren method retrieves the child node ID list for a specified node.

Syntax

GetChildren(parentNodeId As String, Criteria As String, OrderBy As String, ChildIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

parentNodeId

Yes

The ID of the Node for which to retrieve children.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned children. See Node Attributes for a list of possible attribute IDs by which to order.

ChildIdList

Yes

The child Node ID list returned by this method.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered child Node list for parent Node 0000000008 and presents it in a message box.

Sub

Dim aryChildren

GrpClient.GetChildren "0000000008", "~type=~F;~attr0=ATTR_VAL", _

"~cat;~appl1", aryChildren

 

Dim i, strChildren

For i = 0 To UBound(aryChildren)

strChildren = strChildren & aryChildren(i) & vbCr

Next

 

MsgBox strChildren

End Sub

Back to top

GetChildrenRecursive

The GetChildrenRecursive method retrieves the child node ID list recursively for a specified node.

Syntax

GetChildrenRecursive(parentNodeId As String, Criteria As String, OrderBy As String, ChildIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

parentNodeId

Yes

The ID of the Node for which to retrieve children recursively.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned children. See Node Attributes for a list of possible attribute IDs by which to order.

ChildIdList

Yes

The child Node ID list returned by this method.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Remarks

This method differs from GetChildren in that it will perform GetChildren on each returned child Node recursively until a leaf Node is reached.

Example

The following example retrieves a filtered child Node list for parent Node 0000000008 and presents it in a message box.

Sub

Dim aryChildren

GrpClient.GetChildrenRecursive "0000000008", "~type=~F;~attr0=ATTR_VAL", _

"~cat;~appl1", aryChildren

 

Dim i, strChildren

For i = 0 To UBound(aryChildren)

strChildren = strChildren & aryChildren(i) & vbCr

Next

 

MsgBox strChildren

End Sub

Back to top

GetDirectoryNodeIdFromGroupBlobPath

The GetDirectoryNodeIdFromGroupBlobPath method returns the current node ID if a directory is specified and it returns the parent directory node ID if a file (leaf) is specified from the specified BLOB path.

Syntax

GetDirectoryNodeIdFromGroupBlobPath(nodePath As String, grpService As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Node path in the form "\folder1\folder2".

grpService

Yes

The GRP Site.Service to which to connect.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a file, this method will return the directory in which the file is located. If nodePath specifies an invalid path, an empty string is returned.

Example

The following example retrieves the Node ID from both a BLOB path and a file. In both cases, the return value is the same.

Sub getDirNodeId()

MsgBox GrpClient.GetDirectoryNodeIdFromGroupBlobPath _

     ("\MyFolder\file.txt", "CYGDEMO.GRP")

'Returns  "0000000080"

 

MsgBox GrpClient.GetDirectoryNodeIdFromGroupBlobPath _

     ("\MyFolder", "CYGDEMO.GRP")

'Returns  "0000000080"

End Sub

Back to top

GetFileNodeIdFromGroupBlobPath

The GetFileNodeIdFromGroupBlobPath method returns the correct node ID if a file (leaf) node is presented and it returns nothing if a directory is provided.

Syntax

GetFileNodeIdFromGroupBlobPath(nodePath As String, grpService As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Node path in the form "\folder1\file.txt".

grpService

Yes

The GRP Site.Service to which to connect.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies a directory or an invalid path, an empty string is returned.

Example

The following example retrieves the Node ID for the specified file.

Sub getFileNodeId()

MsgBox GrpClient.GetFileNodeIdFromGroupBlobPath _

     ("\MyFolder\Test.txt", "CYGDEMO.GRP")

'Returns  "0000000081"

End Sub

Back to top

GetFirstHierarchyLevelNode

The GetFirstHierarchyLevelNode method retrieves the first hierarchy level node for the specified node.

Syntax

GetFirstHierarchyLevelNode(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the first hierarchy level.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the first hierarchy level Node for a specified Node.

Sub

Dim strNode

strNode = GrpClient.GetFirstHierarchyLevelNode("0000000020")

 

MsgBox strNode

End Sub

Back to top

GetGroupBlobPathFromNodeId

The GetGroupBlobPathFromNodeId method retrieves the Group BLOB path for a specified Node ID.

Syntax

GetGroupBlobPathFromNodeId(nodeID As String, grpService As String) As String

Parameters

Parameter Required Description

nodeID

Yes

The Node ID for which to retrieve a BLOB path.

grpService

Yes

The GRP Site.Service to which to connect.

Remarks

This method works for both files and folders.

If NodeID is invalid or refers to a non-existent Node, an empty string is returned.

Example

The following example retrieves the Node path for the Node that has an ID of 0000000080.

Sub getBlobPath()

MsgBox GrpClient.GetGroupBlobPathFromNodeId("0000000080", "CYGDEMO.GRP")

'Returns  "\MyFolder"

End Sub

Back to top

GetHierarchyAsXml

The GetHierarchyAsXml method retrieves a hierarchy in XML format, starting with the specified Node.

Syntax

GetHierarchyAsXml(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the hierarchy XML.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example Retrieves the hierarchy of a specified Node as an XML string.

Sub

Dim strXml

strXml = GrpClient.GetHierarchyAsXml("0000000008")

 

MsgBox strXml

End Sub

Back to top

GetNodeAppDef1

The GetNodeAppDef1 method retrieves the Node App Defined 1 field for a specified node.

Syntax

GetNodeAppDef1(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node App Defined 1 field.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 1 field of a specified Node.

Sub

MsgBox GrpClient.GetNodeAppDef1("0000000008")

End Sub

Back to top

GetNodeAppDef2

The GetNodeAppDef2 method retrieves the Node App Defined 2 field for a specified node.

Syntax

GetNodeAppDef2(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node App Defined 2 field.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 2 field of a specified Node.

Sub

MsgBox GrpClient.GetNodeAppDef1("0000000008")

End Sub

Back to top

GetNodeAppDef3

The GetNodeAppDef3 method retrieves the Node App Defined 3 field for a specified node.

Syntax

GetNodeAppDef3(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node App Defined 1 field.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node App Defined 3 field of a specified Node.

Sub

MsgBox GrpClient.GetNodeAppDef3("0000000008")

End Sub

Back to top

GetNodeCat

The GetNodeCat method retrieves the Node Category for a specified Node.

Syntax

GetNodeCat(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Category.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Category of a specified Node.

Sub

MsgBox GrpClient.GetNodeCat("0000000008")

End Sub

Back to top

GetNodeDesc

The GetNodeDesc method retrieves the Node Description for a specified node.

Syntax

GetNodeDesc(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Description.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Description of a specified Node.

Sub

MsgBox GrpClient.GetNodeDesc("0000000008")

End Sub

Back to top

GetNodeHierRoot

The GetNodeHierRoot method retrieves the Node Hierarchy Root for a specified node.

Syntax

GetNodeHierRoot(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Hierarchy Root.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Hierarchy Root of a specified Node.

Sub

MsgBox GrpClient.GetNodeHierRoot("0000000008")

End Sub

Back to top

GetNodeIdFromGroupBlobPath

The GetNodeIdFromGroupBlobPath method retrieves the node ID for the node in the specified BLOB node path.

Syntax

GetNodeIdFromGroupBlobPath(nodePath As String, grpService As Variant) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Node path in the form "\folder1\file.txt"

grpService

Yes

The GRP Site.Service to connect to

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Example

The following example retrieves the Node Hierarchy Root of a specified Node.

Sub

MsgBox GrpClient.GetNodeIdFromGroupBlobPath("\1\2\Test.txt", _

"CYGDEMO.GRP")

End Sub

Back to top

GetNodePathList

The GetNodePathList method retrieves the Node path between the specified ancestor and descendant Nodes.

Syntax

GetNodePathList(ancestorNodeId As String, descendantNodeId As String, NodePathList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

ancestorNodeId

Yes

The ID of the starting Node in the path.

descendantNodeId

Yes

The ID of the ending Node in the path.

NodePathList

Yes

The Node path list returned by this method.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Example

The following example retrieves the Node path between two Nodes and presents it in a message box.

Sub

Dim aryPath

GrpClient.GetNodePathList "0000000008", "0000000018", aryPath

 

Dim i, strPath

For i = 0 To UBound(aryPath)

strPath = strPath & aryPath(i) & vbCr

Next

 

MsgBox strPath

End Sub

Back to top

GetNodeRefId

The GetNodeRefId method retrieves the Node Reference ID for a specified node.

Syntax

GetNodeRefId(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Reference Id.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference ID of a specified Node.

Sub

MsgBox GrpClient.GetNodeRefId("0000000008")

End Sub

Back to top

GetNodeRefService

The GetNodeRefService method retrieves the Node Reference Service for a specified node.

Syntax

GetNodeRefService(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Reference Service.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference Service of a specified Node.

Sub

MsgBox GrpClient.GetNodeRefService("0000000008")

End Sub

Back to top

GetNodeRefSite

The GetNodeRefSite method retrieves the Node Reference Site for a specified node.

Syntax

GetNodeRefSite(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Reference Site.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Reference Site of a specified Node.

Sub

MsgBox GrpClient.GetNodeRefSite("0000000008")

End Sub

Back to top

GetNodes

The GetNodes method retrieves the Node ID list for matching criteria.

Syntax

GetNodes(Criteria As String, OrderBy As String, NodeIdList As Variant, GrpSiteService As Variant)

Parameters

Parameter Required Description

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the Nodes.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned Nodes. See Node Attributes for a list of possible attribute IDs by which to order.

NodeIdList

Yes

The Node ID list returned by this method.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered Node list and presents it in a message box.

Sub

Dim aryNodes

GrpClient.GetNodes "~type=~F;~attr0=ATTR_VAL", _

"~cat;~appl1", aryNodes

 

Dim i, strNodes

For i = 0 To UBound(aryNodes)

strNodes = strNodes & aryNodes(i) & vbCr

Next

 

MsgBox strNodes

End Sub

Back to top

GetNodeSecApp

The GetNodeSecApp method retrieves the Node Security Application for a specified Node.

Syntax

GetNodeSecApp(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Security Application.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Security Application of a specified Node.

Sub

MsgBox GrpClient.GetNodeSecApp("0000000008")

End Sub

Back to top

GetNodeSecEvent

The GetNodeSecEvent method retrieves the Node Security Event for a specified node.

Syntax

GetNodeSecurityEvent(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Security Event.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Security Event of a specified node.

Sub

MsgBox GrpClient.GetNodeSecEvent("0000000008")

End Sub

Back to top

GetNodeType

The GetNodeType method retrieves the Node Type for a specified node.

Syntax

GetNodeType(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to retrieve the Node Type.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves the Node Type of a specified Node.

Sub

MsgBox GrpClient.GetNodeType("0000000008")

End Sub

Back to top

GetParents

The GetParents method retrieves the parent Node ID list for a specified node.

Syntax

GetParents(childNodeId As String, Criteria As String, OrderBy As String, ParentIdList As Variant, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

childNodeId

Yes

The ID of the Node for which to retrieve parents.

Criteria

Yes

A set of semicolon-separated column/value parameter pairs used to filter the parents.  See Node Attributes for a list of possible attribute IDs by which to filter.

OrderBy

Yes

A semicolon-separated list of columns by which to order the list of returned parents. See Node Attributes for a list of possible attribute IDs by which to order.

ParentIdList

Yes

The parent Node ID list returned by this method.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves a filtered parent Node list for parent Node 0000000018 and presents it in a message box.

Sub

Dim aryParents

GrpClient.GetParents "0000000018", "~type=~F;~attr0=ATTR_VAL", _

"~cat;~appl1", aryParents

 

Dim i, strParents

For i = 0 To UBound(aryParents)

strParents = strParents & aryParents(i) & vbCr

Next

 

MsgBox strParents

End Sub

Back to top

GetReferences

The GetReferences method retrieves data for the services the GRP client references.

Syntax

GetReferences(GrpSiteService As Variant) As Integer

Parameters

Parameter Required Description

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example retrieves data for referenced services and displays a referenced service in a message box.

Sub

GrpClient.GetReferences()

MsgBox GrpClient.AccessControlService

End Sub

Back to top

HasAuxData

The HasAuxData method returns true if the specified node has auxiliary data stored.

Syntax

HasAuxData(nodeId As String, grpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for auxiliary data.

grpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node has auxiliary data.

Sub

MsgBox GrpClient.HasAuxData("0000000008")

End Sub

Back to top

HasChildren

The HasChildren method returns true if the specified node has any children.

Syntax

HasChildren(nodeId As String, Criteria As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for children.

Criteria Yes A set of semicolon-separated column/value parameter pairs used to filter the children.  See Node Attributes for a list of possible attribute IDs by which to filter.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a node has children.

Sub

MsgBox GrpClient.HasChildren("0000000008")

End Sub

Back to top

HasParents

The HasParents method returns true if the specified Node has any parents.

Syntax

HasParents(nodeId As String, Criteria As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for parents.

Criteria Yes A set of semicolon-separated column/value parameter pairs used to filter the parents.  See Node Attributes for a list of possible attribute IDs by which to filter.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node has parents.

Sub

MsgBox GrpClient.HasParents("0000000008")

End Sub

Back to top

IsExpandable

The IsExpandable method returns true if the specified node is expandable.

Syntax

IsExpandable(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for expandability.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node is expandable.

Sub

MsgBox GrpClient.IsExpandable("0000000008")

End Sub

Back to top

IsValidPath

The IsValidPath method returns true if the specified node path is valid.

Syntax

IsViewable(nodePath As String) As Boolean

Parameters

Parameter Required Description

nodePath

Yes

A Node path to check for validity.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method does not check whether or not the Nodes in a path actually exist.  Rather, it ensures that the nodePath parameter is in the correct Node path format.

Example

The following example checks whether or not a Node path is valid.

Sub

MsgBox GrpClient.IsValidPath("\Root\Hierarchy\View\Level")

'displays True

End Sub

Back to top

IsViewable

The IsViewable method returns true if the specified node is viewable.

Syntax

IsViewable(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for viewability.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a Node is viewable.

Sub

MsgBox GrpClient.IsViewable("0000000008")

End Sub

Back to top

LoadAdminNodesForHierarchy

The LoadAdminNodesForHierarchy method loads admin nodes from a file into the Group service.

Syntax

LoadAdminNodesForHierarchy(grpService As String, filename As String, facSourcesToReplace As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to connect to.

filename

Yes

The path to the file containing the admin Nodes to load.  This file must be a binary file, in the same format as the files generated by SaveAdminNodesForHierarchy.

facSourcesToReplace

Yes

A set of semicolon-separated parameters specifying both strings to be replaced, and the replacement strings (for example, "SOMEONE.UIS=CYGDEMO.UIS;SOMEONE.FAC=CYGDEMO.FAC").

filetype

Yes

The only supported value for this parameter is:

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method will only load admin Nodes into the GRP service.  To load all other Nodes, use LoadNodes.

Example

The following example loads admin Nodes from a file into the GRP service, and replaces all instances of "SOMEONE.UIS" with "CYGDEMO.UIS".

Sub

Dim strNodesToReplace

strNodesToReplace = "SOMEONE.UIS=" & GrpClient.SiteService

 

GrpClient.LoadAdminNodesForHierarchy GrpClient.SiteService, _

"C:\MyAdminNodes.dat", strNodesToReplace, 1

End Sub

Back to top

LoadHierarchyCache

The LoadHierarchyCache method loads a hierarchy into the cache, starting with the specified node.

Syntax

LoadHierarchyCache(nodeId As String, nMaxLevels As Long, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node at the top of the hierarchy to load into the cache.

nMaxLevels

Yes

The maximum number of levels in the hierarchy to load into the cache.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example loads 5 levels of the hierarchy starting with Node 0000000008 into the cache.

Sub

GrpClient.LoadHierarchyCache "0000000008", 5

End Sub

Back to top

LoadNodes

The LoadNodes method loads nodes from a file into the Group service.

Syntax

LoadNodes(grpService As String, filename As String, facSourcesToReplace As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to connect to.

filename

Yes

The path to the file containing the Nodes to load.  This file must be a binary file, in the same format as the files generated by SaveNodes.

facSourcesToReplace

Yes

A set of semicolon-separated parameters specifying both strings to be replaced, and the replacement strings (for example, "SOMEONE.UIS=CYGDEMO.UIS;SOMEONE.FAC=CYGDEMO.FAC").

filetype

Yes

The only supported value for this parameter is:

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Example

The following example loads Nodes from a file into the GRP service, and replaces all instances of "SOMEONE.UIS" with "CYGDEMO.UIS".

Sub

Dim strNodesToReplace

strNodesToReplace = "SOMEONE.UIS=" & GrpClient.SiteService

 

GrpClient.LoadNodes GrpClient.SiteService, _

"C:\MyNodes.dat", strNodesToReplace, 1

End Sub

Back to top

MoveGroupBlob

The MoveGroupBlob method moves a Group BLOB node to a specified location.

Syntax

MoveGroupBlob(nodePath As String, newPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path the node to be moved in the form "\\SITE.SERVICE\folder1\file.txt".

newPath

Yes

The new path for the Node. This must be relative to nodePath, and in the form "\folder1\folder2".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a file. Directories cannot be moved. The method will fail and display an error if a file with the same name already exists at newPath, or if nodePath or newPath specifies an invalid path.

Example

The following example moves "Test.txt" from folder "2" to folder "3", and alerts the user that only one copy exists.

Sub moveBlob()

GrpClient.MoveGroupBlob "\\CYGDEMO.GRP\1\2\Test.txt", "\1\3"

MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\2\Test.txt")  'Returns False

MsgBox GrpClient.FileExists("\\CYGDEMO.GRP\1\3\Test.txt")  'Returns True

End Sub

Back to top

NodeExists

The NodeExists method returns true if the specified node exists.

Syntax

NodeExists(nodeId As String, GrpSiteService As Variant) As Boolean

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node to check for existence.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example checks whether or not a node exists.

Sub

MsgBox GrpClient.NodeExists("0000000008")

End Sub

Back to top

NodeIsADirectory

The NodeIsADirectory method returns true if the specified node is a directory and returns false if the specified node is a file.

Syntax

NodeIsADirectory(nodeID As String, grpService As String) As Boolean

Parameters

Parameter Required Description

nodeID

Yes

A string containing a valid Node ID.

grpService

Yes

The GRP Site.Service to connect to.

Example

The following example checks if the Node is a directory and alerts the user.

Sub nodeIsDir()

Dim isDir

isDir = GrpClient.NodeIsADirectory("0000000081", GrpClient.SiteService)

If isDir Then

     edtMessage.Text = "The node is a directory"

Else

     edtMessage.Text = "The node is not a directory"

End If

End Sub

Back to top

NodeIsAFile

The NodeIsAFile method correctly returns true if the specified node is a file and returns false if the specified node is a directory.

Syntax

NodeIsAFile(nodeID As String, grpService As String) As Boolean

Parameters

Parameter Required Description

nodeID

Yes

A string containing a valid Node ID.

grpService

Yes

The GRP Site.Service to connect to.

Example

The following example checks if the node is a file and alerts the user.

Sub nodeIsFile()

Dim isFile

isFile = GrpClient.NodeIsAFile("0000000080", GrpClient.SiteService)

If isFile Then

     edtMessage.Text = "The node is a file"

Else

     edtMessage.Text = "The node is not a file"

End If

End Sub

Back to top

ReadAuxData

The ReadAuxData method returns a specified node’s auxiliary data.

Syntax

ReadAuxData(nodeId As String, GrpSiteService As Variant) As String

Parameters

Parameter Required Description

nodeId

Yes

The ID of the node from which to retrieve auxiliary data.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example displays a node’s auxiliary data.

Sub

MsgBox GrpClient.ReadAuxData("0000000008")

End Sub

Back to top

ReadGroupBlob

The ReadGroupBlob method reads data from the Group BLOB node.

Syntax

ReadGroupBlob(nodePath As String) As String

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB path to the node to be read from in the form "\\SITE.SERVICE \folder1\file.txt".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a text file.

If nodePath specifies an invalid path or a directory, an empty string is returned.

This method with return the text stored inside of the file.

Example

The following example stores the contents of "File.txt" in a variable and displays it in an edit box.

Sub readBlob()

Dim strFile

strFile = GrpClient.ReadGroupBlob("\\CYGDEMO.GRP\MyFolder\File.txt")

edtMessage.Text = strFile

End Sub

Back to top

ReadGroupBlobToFile

The ReadGroupBlobToFile method reads data from the specified Group BLOB node and stores it in a specified file.

Syntax

ReadGroupBlobToFile(nodePath As String, dataPath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path to be read from in the form "\\SITE.SERVICE \folder1\file.txt".

dataPath

Yes

A valid local file path to which the data will be written.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath and dataPath must specify text files. The file specified by DataPath will be overwritten or created once a valid directory exists.

If nodePath specifies an invalid path, an empty file will be created. If DataPath specifiies an invalid path, no file will be created and no error will be displayed.

Example

The following example saves the BLOB file "File.txt" as "Test.txt".

Sub readBlobToFile()

GrpClient.ReadGroupBlobToFile "\\CYGDEMO.GRP\MyFolder\File.txt", "C:\Test.txt"

edtMessage.Text = "C:\Test.txt has been created"

End Sub

Back to top

RemoveGroupBlobDir

The RemoveGroupBlobDir method removes the Group BLOB node from the hierarchy if it is a directory-type node.

Syntax

RemoveGroupBlobDir(nodePath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB path to the node to be removed in the form "\\SITE.SERVICE \folder1\folder2\".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path, an error will be displayed. If nodePath specifies a file, the file will be deleted.

Example

The following example deletes the "MyFolder" directory from the BLOB.

Sub removeBlobDir()

GrpClient.RemoveGroupBlobDir "\\CYGDEMO.GRP\MyFolder\ "

edtMessage.Text = "MyFolder has been removed"

End Sub

Back to top

RemoveGroupBlobFile

The RemoveGroupBlobFile method removes the Group BLOB node from the hierarchy if it is a file-type node.

Syntax

RemoveGroupBlobFile(nodePath As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path to be removed in the form "\\SITE.SERVICE \folder1\file.txt".

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path or a directory, an error will be displayed.

Example

The following example deletes "Test.txt" from the BLOB.

Sub removeBlobFile()

GrpClient.RemoveGroupBlobFile "\\CYGDEMO.GRP\MyFolder\Test.txt"

edtMessage.Text = "Test.txt has been removed"

End Sub

Back to top

RenameGroupBlob

The RenameGroupBlob method renames a Group BLOB node folder or file.

Syntax

RenameGroupBlob(nodePath As String, newName As String)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB Node pathto the node to be renamed in the form "\\SITE.SERVICE \folder1\folder2".

newName

Yes

The new name for the Group BLOB node.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

If nodePath specifies an invalid path, an error will be displayed. This method will fail if a file or folder already exists with the same name as newName.

Example

The following example renames "MyFolder" to "Test" and alerts the user.

Sub renameBlob()

GrpClient.RenameGroupBlob "\\CYGDEMO.GRP\MyFolder", "Test"

edtMessage.Text = GrpClient.DirectoryExists("\\CYGDEMO.GRP\Test")

'Returns True

End Sub

Back to top

SaveAdminNodesForHierarchy

The SaveAdminNodesForHierarchy method saves admin Nodes in a specified hierarchy to a file.

Syntax

SaveAdminNodesForHierarchy(grpService As String, hierarchy As String, filename As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to connect to.

hierarchy

Yes

The description of a Navigation Root Node.  This Node must be of type Navigation Root (~V) and in the Root Group (R) category.

filename

Yes

The name of the file (including the path) to which to save the admin Nodes.

filetype

Yes

The only supported value for this parameter is:

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

This method will only save admin Nodes.  To save all other Nodes, use SaveNodes.

Example

The following example saves admin Nodes to a file.

Sub

GrpClient.SaveAdminNodesForHierarchy "CYGDEMO.GRP", "Navigation Hierarchy", _

"C:\MyAdminNodes.dat", 1

End Sub

Back to top

SaveNodes

The SaveNodes method saves a Node and all of its children to a file.

Syntax

SaveNodes(grpService As String, nodeID As String, filename As String, filetype As Long)

Parameters

Parameter Required Description

grpService

Yes

The GRP Site.Service to connect to.

nodeID

Yes

The ID of the Node at the top of the hierarchy to save.

filename

Yes

The name of the file (including the path) to which to save the Nodes.

filetype

Yes

The only supported value for this parameter is:

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Example

The following example saves Nodes to a file.

Sub

GrpClient.SaveNodes "CYGDEMO.GRP", "0000000008", "C:\MyNodes.dat", 1

End Sub

Back to top

UpdateNodeAttribute

The UpdateNodeAttribute method updates a specified Node’s attribute.

Syntax

UpdateNodeAttribute(nodeId As String, attrId As String, attrValue As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeId

Yes

The ID of the Node for which to update an attribute.

attrId

Yes

The ID of the attribute to update.

attrValue

Yes

The new value for the attribute.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example updates a Node’s attribute.

Sub

GrpClient.UpdateNodeAttribute "0000000008", "~attr0", "NEW_VALUE"

End Sub

Back to top

WriteAuxData

The WriteAuxData method writes auxiliary data to the specified group node.

Syntax

WriteAuxData(nodeID As String, textData As String, GrpSiteService As Variant)

Parameters

Parameter Required Description

nodeID

Yes

The ID of the Node to which to write auxiliary data.

textData

Yes

The auxiliary data to write to the Node.

GrpSiteService

No

The optional GRP Site.Service to connect to.  If this parameter is not specified, this method will use the currently connected Site.Service (via Connect).

Example

The following example writes auxiliary data to a node.

Sub

GrpClient.WriteAuxData "0000000008", "Some auxiliary data"

End Sub

Back to top

WriteGroupBlob

The WriteGroupBlob method writes data to the Group BLOB node in the path.

Syntax

WriteGroupBlob(nodePath As String, nodeData As String, CreateDirectory As Boolean)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path to be written to in the form "\\SITE.SERVICE \folder1\file.txt".

nodeData

Yes

The data to be written.

CreateDirectory

Yes

If this parameter is set to True, the directory specified by nodePath will be created if it does not already exist.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath must specify a text file. If nodePath specifies a directory, or if Create is set to False and nodePath specifies a non-existent directory, an error will be displayed.

Example

The following example writes a new file to the BLOB containing the text "Hello World!"

Sub writeBlob()

     GrpClient.WriteGroupBlob "\\CYGDEMO.GRP\MyFolder\File.txt", "Hello World!", True

End Sub

Back to top

WriteGroupBlobFromFile

The WriteGroupBlobFromFile method writes data from a file to the Group BLOB node at the specified path.

Syntax

WriteGroupBlobFromFile(nodePath As String, dataPath As String, CreateDirectory As Boolean)

Parameters

Parameter Required Description

nodePath

Yes

A valid Group BLOB node path to be written to in the form "\\SITE.SERVICE \folder1\file.txt".

dataPath

Yes

The local file path to the data to be written.

CreateDirectory

Yes

If this parameter is set to True, the directory specified by nodePath will be created if it does not already exist.

See Group BLOB Naming Rules above for information about naming rules for file names and file paths.

Remarks

nodePath and DataPath must specify text files. Binary data is not supported.

If nodePath specifies a directory, or if Create is set to False and nodePath specifies a non-existent directory, an error will be displayed.

If DataPath specifies an invalid path, an empty text document will be created at the path specified by nodePath.

Example

The following example writes the data from local file "New.txt" to the BLOB path as "Hi.txt".

Sub writeBlobFile()

GrpClient.WriteGroupBlobFromFile _

     "\\CYGDEMO.GRP\Folder\Hi.txt", "C:\New.txt", True

edtMessage.Text = "New.txt has been added to the blob"

End Sub

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.